﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace BrokerBase.Lib.Product
{
    public class Duty:IDuty
    {
        private Action<IPolicyPeriodActing, IDutyActing> action;

        public Duty()
        {
            Sort = 50;//默认等于10
        }

        public Duty(IProduct product):this()
        {
            Owner = product;
        }

        public virtual IProduct Owner{get;set;}

        public virtual string Name{get;set;}

        public virtual int Sort { get; set; }

        public virtual string Description{get;set;}

        public virtual string InsurantStates { get; set; }

        public virtual string HolderStates { get; set; }

        public virtual string Code{get;set;}

        public virtual int Id { get; set; }

        public virtual Action<IPolicyPeriodActing, IDutyActing> Action
        {
            get
            {
                if (!Owner.IsCompiled)
                    Owner.Compile();

                return action;
            }
            set
            {
                action = value;
            }
        }


        


        

    }
}
